//
//  ImageDownloader.h
//  UI-17-图片异步下载
//
//  Created by lanou3g on 15/8/30.
//  Copyright (c) 2015年 自由科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol DownloaderDelegate <NSObject>
- (void)downloaderDidFinishDownloadImg:(UIImage *)image;
@end


typedef void(^BLOCK) (UIImage *image);
@interface ImageDownloader : NSObject

@property (nonatomic, copy) BLOCK block;

//*****************************************************
//封装同步下载
+ (UIImage *)sychronousDownloader:(NSString *)imgURL;
//*****************************************************




//*****************************************************
@property (nonatomic, assign) id <DownloaderDelegate> delegate;
//封装异步下载图片
+ (void)asendAsynchronousDownloader:(NSString *)imgURL andDelegate:(id<DownloaderDelegate>)delegate;
//*****************************************************

//*******BLOCK*封装异步下载图片*********************************************
+ (void)asendAsynchronousDownloader:(NSString *)imgURL andBlock:(BLOCK)block;
//*****************************************************


//动态方法
- (void)delegateAsendAsynchronousDownloader:(NSString *)imgURL;

- (void)blockAsendAsynchronousDownloader:(NSString *)imgURL;



@end
